<!-- 待评价 -->
<template>
    <div>
        <div class="allmygood" v-for="item in OrderInformation" :key="item.id" v-show="item.chengxu==4">
            <div style="margin-bottom: 8px;">
                <span>{{item.mingcheng}}</span>
                <span style=" color:red; position: absolute;right: 8px;">{{item.jiaoyijg==0?'交易成功':'交易关闭'}}</span>
            </div>
            <div style=" height: 80px;" >
                <img style=" float: left; width: 80px;height: 80px;border-radius: 6px; margin-right: 8px;" :src="item.img" alt="图片丢失">
                <div @click="details(item.id)" style=" float: left; width: 180px;">
                    <div>{{item.name}}</div>
                    <span style="color: gray; display: block;">{{item.yangse}}</span>
                    <van-tag type="warning">七天换货</van-tag>
                </div>
                <div style=" float: right; color: gray; right: 8px;">
                    <div>{{item.age}}</div>
                    <div style=" float: right;">x{{item.jiang}}</div>
                </div>
            </div>
            <div style=" height: 20px;">
                <span style=" float: left; margin-left: 40px;">运费险</span>
                <span style=" float: left; margin-left: 8px; color: gray;">{{item.yfx}}</span>
                <span style=" float: right; color: red;">{{item.ysx}}</span>
            </div>
            <div style=" height: 20px;">
                <span style=" margin-left: 90px; color: gray;">共{{item.jiang}}件商品</span>
                <span style=" float: right; right: 8px;">合计：￥{{item.jiang*item.age}}</span>
            </div>
            <div style=" height: 36px; position: relative;">
                <van-button round plain color="black" size="mini" @click="getAfterSales(item.id)" style="padding: 0px 12px 0px 12px; position: absolute; right: 56px; bottom: 4px;">申请售后</van-button>
                <van-button round plain color="red" size="mini" @click="getevaluation" style="padding: 0px 12px 0px 12px; position: absolute; right: 0px; bottom: 4px;">评价</van-button>
            </div>            
        </div>
    </div>
</template>
<script setup lang="ts">
import { onMounted,reactive,ref} from "vue";
import {getorder} from '@/api/order.ts';
import { useRouter } from "vue-router";
const router =useRouter();
const details=(id)=>{
    router.push({path:'/detailsbody5',query:{id:id}})
}
const getevaluation = () =>{
    router.push('/evaluation')
}
let OrderInformation = ref([]);
onMounted(() => {
    getorder()
    .then(res=>{
            OrderInformation.value=res.data.data
            console.log(OrderInformation);
    })
});
const getAfterSales = (id)=>{
    router.push({path:'/AfterSales',query:{id:id}})
}
</script>
<style>
    .allmygood{
        font-size: 14px;
        position: relative;
        margin:12px;
        margin-top: 16px;
        padding: 8px;
        box-sizing: border-box;
        border-radius: 8px;
        box-shadow: 0px 0px 4px 4px rgba(0, 0, 0, 0.1);
    }
</style>